home *** CD-ROM | disk | FTP | other *** search
- // Bits.h: interface for the CBits class.
- //
- //////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_)
- #define AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
-
- struct bits_data {
- /* bit input */
- int Infile;
- unsigned char *Rdbfr;
- unsigned char *Rdptr;
- unsigned char Inbfr[16];
- unsigned int Bfr;
- unsigned char *Rdmax;
- int Incnt;
- int Bitcnt;
- };
-
- struct PESinfo
- {
-
- bool pack_header_parsed; // flag that indicates if the PES was the first in the Pack
- unsigned int pack_bytes; // number of bytes inside the Pack from the byte containing
- // the last bit of SCRbase field
-
- int streamID; // streamID of the PES
- int subStreamID; // subStreamID of the PES
-
- // Pack info
- __int64 SCR; // System Clock Reference referred to a 27Mhz clock
- int muxrate; // Pack muxrate in bytes per second
-
- // PES info
- __int64 PTS; // Presentation Time Stamp referred to a 27Mhz clock
- int payloadSize; // size in bytes of data contained inside the PES packet
- bool isValidData; // flag to specify if the data returned is valid or not
- };
-
-
- class CBitSource {
- public:
- //virtual int read(void *buffer, int bytes)=0;
- virtual int ReadPES(unsigned char **buffer, PESinfo *PES)=0;
- };
-
-
- class CBits
- {
- public:
- int streamID;
- int subStreamID;
- unsigned int Get_Bits(int N);
- unsigned int Get_Bits1();
- unsigned int Show_Bits(int N);
- int Get_Word();
- int Get_Byte();
- void Initialize_Buffer();
- CBits(CBitSource *source, int streamID, int subStreamID);
- ~CBits();
- PESinfo PES;
- bool eos;
- void Flush_Buffer(int N);
- void Fill_Buffer();
-
- private:
- bits_data *ld;
- CBitSource * src;
- int audioBufferSize;
- };
-
- #endif // !defined(AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_)
-